Environment Configuration
The André Ruperto Portfolio requires environment variables for the backend to function properly. These variables control database connections, email services, authentication, and server configuration.Backend Environment Variables
Create a.env file in the backend/ directory with the following variables:
backend/.env
Required Variables
Database URL
Configure your PostgreSQL database connection:Example:
Replace
USER, PASSWORD, HOST, PORT, and DATABASE with your actual PostgreSQL credentials.Resend API Key
Set up email functionality with Resend:How to get your API key:
- Sign up at resend.com
- Navigate to API Keys section
- Create a new API key
- Copy and paste it into your
.envfile
The Resend API is used for the contact form functionality.
Admin Password
Set a secure password for accessing admin features:
Use a strong, unique password. This password is used to access email previews and admin features.
JWT Secret
Generate a secure JWT secret for authentication:Generate a secure secret:Copy the output and use it as your
JWT_SECRET.Server Port
Configure the backend server port (optional):Default is
3001. Change if this port is already in use.Complete .env Example
Frontend Configuration
The frontend uses Vite and requires no separate environment file. Configuration is handled invite.config.ts:
vite.config.ts
8080 and proxies API requests to the backend on port 3001.
Database Schema
The project uses Prisma ORM with PostgreSQL. The main model is:schema.prisma
Verification
Verify your environment setup:Security Best Practices
- Never commit
.envfiles to version control - Use strong, unique passwords and secrets
- Rotate JWT secrets regularly in production
- Use different credentials for development and production
- Keep your Resend API key private
Next Steps
- Development - Start the development server
- Deployment - Deploy to production
