-
Notifications
You must be signed in to change notification settings - Fork 17
Issue 2 3 7 8 resolved #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Initialized a Node.js backend under ./backend with Express.js and minimal dependencies (express, cors, body-parser, cookie-parser, dotenv). Implemented a health check route at /health returning a simple "OK" response to verify server status. Added middleware setup for CORS, cookies, and JSON parsing, ensuring clean request handling. Created a Next.js frontend in ./frontend/ to prepare for future full-stack integration. Established an organized project structure including controllers, models, routes, services, utils, and config directories. Added basic .env and README.md files to document project purpose and setup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR establishes the foundational structure for a full-stack application by creating separate frontend and backend directories with basic implementations. The setup includes a Next.js frontend application and an Express.js backend server with a health check endpoint.
- Created a complete Next.js frontend application with TypeScript, Tailwind CSS, and ESLint configuration
- Implemented a basic Express.js backend server with essential middleware and a health check endpoint
- Established organized folder structure for both frontend and backend components
Reviewed Changes
Copilot reviewed 20 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/* | Complete Next.js application setup with TypeScript, Tailwind CSS, and default landing page |
| backend/index.js | Express server with middleware configuration and health check endpoint |
| backend/package.json | Backend dependencies including Express, CORS, and development tools |
| backend/.env | Environment configuration with port setting |
| backend/*/README.md | Documentation for organized folder structure (controllers, models, routes, etc.) |
Files not reviewed (1)
- backend/package-lock.json: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "dev" : " nodemon index.js" |
Copilot
AI
Oct 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Extra space before 'nodemon' in the dev script command should be removed for consistency.
| app.use(cors({ | ||
| origin : '*' | ||
| })) |
Copilot
AI
Oct 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using wildcard '*' for CORS origin allows all domains, which poses security risks in production. Consider restricting to specific allowed origins.
| app.use(cors({ | |
| origin : '*' | |
| })) | |
| // Restrict CORS origins to trusted domains from environment variable | |
| const allowedOrigins = process.env.CORS_ORIGIN | |
| ? process.env.CORS_ORIGIN.split(',').map(origin => origin.trim()) | |
| : ['http://localhost:3000']; // fallback for development | |
| app.use(cors({ | |
| origin: function (origin, callback) { | |
| // allow requests with no origin (like mobile apps, curl, etc.) | |
| if (!origin) return callback(null, true); | |
| if (allowedOrigins.indexOf(origin) !== -1) { | |
| return callback(null, true); | |
| } else { | |
| return callback(new Error('Not allowed by CORS')); | |
| } | |
| } | |
| })); |
|
Can't accept any PR without being assigned to that particular issue |
Description
Semver Changes
Issues
Checklist