The project uses pnpm for package management and scripts. Make sure to install it before getting your hands dirty with the code.
pnpm- >v9.0.0node- >v20.0.0docker- >v27.0.0
The Project requires the following set of Environmental variables for running in development environment. Database related variables can be omitted for the production environment (as the backend lives on a different service).
| Variable Name | What It Does? | Example |
|---|---|---|
BACKEND_BASE_URL |
URL where the backend is running | http://localhost:8080 |
SMTP_HOST |
Host URL for connection to the E-Mail Server | smtp.ethereal.email |
SMTP_PORT |
Port for connection to the E-Mail Server | 587 |
SMTP_EMAIL |
E-mail used for E-Mail Server | dummy.email@acm-pec.edu.in |
SMTP_PASS |
Password for E-Mail Server | AReally$tr0ngPa55w0rd |
POSTGRES_DB |
Database name for the Postgres Database | acm |
POSTGRES_USER |
Username for the Postgres Database | acmsecy |
POSTGRES_PASSWORD |
Password for the Postgres Database | acmhead |
| Command | Description |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Build for production |
pnpm serve |
Preview production build |
pnpm fmt |
Run formatter |
pnpm fmt:write |
Run formatter and fix issues |
pnpm lint |
Run linting checks |
pnpm lint:fix |
Run linting checks and fix issues |
pnpm check |
Run all checks (format, lint, imports) |
pnpm check:write |
Run checks and fix issues |
- Set Environment Variables
- Copy the example
.envfile and update it with your values (see the Environment Variables table above for details)
- Copy the example
cp .env.example .envWarning
Never commit your .env file to version control. Verify it's listed in .gitignore.
Tip
If you want to test routes that use the email server, You can use ethereal.email to generate SMTP credentials.
- Spin up a container with the postgres server and backend server using the compose file
docker-compose.yml.
docker compose up -dImportant
Make sure to use the -v flag when destroying the container to remove volumes.
docker compose down -v-
Verify Services Are Running
- Backend:
http://localhost:8080 - PostgreSQL:
localhost:5432
The database is pre-seeded with test data. Use these credentials:
- Email:
harshpreetsinghjohar.btcse20@pec.edu.in - Password:
admin123
- Backend:
Check Docker logs if services fail to start:
docker compose logs- Install Dependencies
pnpm install- Run Dev Server
- The frontend dev server should now be running on port
3000
pnpm devThe project includes path aliases for commonly used internal packages/libraries which should be used to avoid long import paths in the code. These are configured in the project typescript config tsconfig.json.
$components→src/components$data→src/data$env→src/lib/env$emails→src/emails$hooks→src/hooks$lib→src/lib$assets→src/lib/assets$styles→src/styles
This project uses Oxlint for formatting and linting. Pre-commit hooks are configured with Husky. You can install Oxlint's Extension for your code editor to show you linting hints and help you with formatting the files on save.
See the Available Scripts section for formatting and linting commands.
Husky runs the check script on the pre-commit event.
Read the full style guide: CODE_STYLE.md