Lightweight web application for recording and managing campus recruitment and placement records. The project contains:
- Backend: Spring Boot (Java 17) with PostgreSQL
- Frontend: React (Create React App)
- Docker + docker-compose for local development
Tech stack
- Java 17, Spring Boot 3.x
- PostgreSQL (Postgres 16 image in docker-compose)
- React (Create React App)
- Docker / Docker Compose
Quick start (recommended — Docker Compose)
- From the repository root run:
docker-compose up --buildThis starts Postgres (5432) and the backend (8080). The frontend runs separately with npm start.
Run backend locally without Docker
- Configure environment variables used by
application.properties:
DB_URL(e.g.jdbc:postgresql://localhost:5432/campus)DB_USER(e.g.campus)DB_PASS(e.g.campus0987)PORT(optional, defaults to8080)APP_JWT_SECRETorapp.jwt.secret(token signing key)
- Build and run (Unix / macOS):
mvnw clean package -DskipTests
java -jar backend/target/backend-0.0.1-SNAPSHOT.jarOn Windows use mvnw.cmd in the same way.
Run frontend locally
- Change to the frontend folder and install dependencies:
cd campus-frontend
npm install
npm start- Note: the frontend currently contains hard-coded production backend URLs (for example in
src/auth/Login.jsx,src/auth/Signup.jsx, andsrc/pages/AdminDashboard.jsx). To test locally, update those URLs tohttp://localhost:8080or implement aREACT_APP_API_URLenvironment variable and use it in the code.
Database defaults (docker-compose)
- Image:
postgres:16 - DB name:
campus - User:
campus - Password:
campus0987
These are set in backend/docker-compose.yaml.
Important backend configuration files
backend/src/main/resources/application.properties— readsDB_URL,DB_USER,DB_PASS,PORT, and JWT properties.backend/Dockerfile— multi-stage build that packages the Spring Boot JAR.backend/docker-compose.yaml— starts Postgres and the backend together for local testing.
API (key endpoints)
- POST /api/auth/users/login — Login (returns JWT token)
- POST /api/auth/users/register — Register new user
- PUT /api/admin — Update admin email/password (requires admin principal)
- POST /api/company — Add company (admin)
- POST /api/placement — Add placement record (admin)
- GET /api/placements — List placements
- GET /api/recruitment — List companies
All server endpoints are served on port 8080 by default.
Notes & deployment
- The frontend in this repo points to a deployed backend URL (
https://campus-backend-qvke.onrender.com). Update the frontend to point to your backend when running locally. - For production builds of the frontend:
cd campus-frontend && npm run buildand serve thebuild/output using your preferred static hosting. - You can build container images with
docker build(backend Dockerfile included) and orchestrate withdocker-compose.
License
This repository references an MIT license badge in the original README. Add a LICENSE file if you intend to release under MIT.
If you'd like, I can:
- update the frontend to use a
REACT_APP_API_URLenv var (safer than hard-coded URLs), - or change the frontend files to point to
http://localhost:8080for local development.
—
Updated README to reflect actual repo structure, run steps, and endpoints.
User— storesid,name,email,password(BCrypt),identityNumber(college ID), androle(USER|ADMIN).Company— storesid,company(name),process,eligibility,companyLink,registerLink.Placement— storesid,studentName,department,company,packageAmount(LPA).
These entities are implemented under backend/src/main/java/com/nagesh/model and persisted using Spring Data JPA repositories in backend/src/main/java/com/nagesh/repository.
- Authentication uses JWT tokens. Login is handled by
POST /api/auth/users/loginwhich returns a token. The backend readsapp.jwt.secretfromapplication.propertiesfor signing/verification. - Admin-only endpoints (company/placement creation and admin update) expect an authenticated principal with role
ADMIN.
DB_URL— JDBC URL for Postgres (e.g.jdbc:postgresql://postgres:5432/campus)DB_USER— Database user (e.g.campus)DB_PASS— Database password (e.g.campus0987)PORT— Backend port (optional, default8080)app.jwt.secret— JWT signing secret (or set asAPP_JWT_SECRETin your env)
These are referenced by backend/src/main/resources/application.properties.
The frontend currently calls a deployed backend URL. For local development change requests to use an environment variable. Example pattern:
- In
campus-frontend, add.envwith:
REACT_APP_API_URL=http://localhost:8080
- Replace hard-coded URLs in the frontend (examples in
src/auth/Login.jsx,src/auth/Signup.jsx, andsrc/pages/AdminDashboard.jsx) withprocess.env.REACT_APP_API_URL+ endpoint path.
Example fetch call after change:
fetch(`${process.env.REACT_APP_API_URL}/api/auth/users/login`, { ... })- Login (replace with correct URL):
curl -X POST http://localhost:8080/api/auth/users/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@example.com","password":"password"}'- Add company (requires admin JWT):
curl -X POST http://localhost:8080/api/company \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-d '{"company":"ACME","process":"Apt→Tech→HR","eligibility":"All","companyLink":"https://acme.example","registerLink":"https://forms.example"}'- If the backend cannot connect to Postgres when using Docker, ensure the
postgresservice is healthy and ports are available. - If JWT auth fails, verify
app.jwt.secretmatches between environments and tokens. - For CORS and frontend local dev, the backend controllers include
@CrossOrigin(origins = "http://localhost:3000")—adjust if your frontend runs on a different origin.
- Add a
LICENSEfile if you want to publish under MIT. - Open issues and PRs for bug fixes and improvements. Keep changes small and include a brief description of behavior and how to test.
If you want, I can update the frontend to read REACT_APP_API_URL and replace the three hard-coded URLs now.