Compare commits
8 Commits
dependabot
...
e3710b93fa
| Author | SHA1 | Date | |
|---|---|---|---|
| e3710b93fa | |||
| 28d1f78e18 | |||
|
|
3a1deddb8c | ||
|
|
441ae8169b | ||
|
|
3bcb5b851d | ||
| 7433052878 | |||
| b6fcc63c82 | |||
| 1648a56680 |
0
.env.example
Normal file
0
.env.example
Normal file
51
README.md
51
README.md
@@ -1,31 +1,28 @@
|
||||
# shadcn/ui monorepo template
|
||||
# NextPlacement
|
||||
|
||||
This template is for creating a monorepo with shadcn/ui.
|
||||
NextPlacement is a placement-management platform built as a monorepo (pnpm workspaces + Turborepo) with multiple apps and shared packages.
|
||||
|
||||
## Usage
|
||||
## Repository Layout
|
||||
- `apps/` - application(s) (e.g., student/admin web apps)
|
||||
|
||||
- `packages/` - reusable packages/libraries used by apps
|
||||
|
||||
- `shared/` - sared code/assets (project-specific)
|
||||
|
||||
- `docker-compose.yml` / `docker-compose.dev.yml` - Docker compose configurations
|
||||
|
||||
- `DOCKER.md` - Docker notes / commands
|
||||
|
||||
## Prerequisites
|
||||
- Git
|
||||
- Node.js (LTS recommended)
|
||||
- pnpm
|
||||
- Docker Desktop (recommended for easiest setup)
|
||||
|
||||
## Quick Start (Docker)
|
||||
1. Create environment file:
|
||||
- Create `.env` in the project root (or copy from `.env.example` if present)
|
||||
|
||||
2.Start containers:
|
||||
```bash
|
||||
pnpm dlx shadcn@latest init
|
||||
```
|
||||
|
||||
## Adding components
|
||||
|
||||
To add components to your app, run the following command at the root of your `web` app:
|
||||
|
||||
```bash
|
||||
pnpm dlx shadcn@latest add button -c apps/web
|
||||
```
|
||||
|
||||
This will place the ui components in the `packages/ui/src/components` directory.
|
||||
|
||||
## Tailwind
|
||||
|
||||
Your `tailwind.config.ts` and `globals.css` are already set up to use the components from the `ui` package.
|
||||
|
||||
## Using components
|
||||
|
||||
To use the components in your app, import them from the `ui` package.
|
||||
|
||||
```tsx
|
||||
import { Button } from '@workspace/ui/components/button';
|
||||
```
|
||||
docker-compose up --build
|
||||
|
||||
2
apps/admin/.env.example
Normal file
2
apps/admin/.env.example
Normal file
@@ -0,0 +1,2 @@
|
||||
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/nextplacement
|
||||
AUTH_SECRET=change_me
|
||||
@@ -5,8 +5,8 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "dotenv -e ../../.env -- next dev --turbopack -p 9001",
|
||||
"build": "dotenv -e ../../.env -- next build",
|
||||
"start": "dotenv -e ../../.env -- next start -p 9001",
|
||||
"build": "dotenv -e ../../.env -- next build && cp -r .next/static .next/standalone/apps/admin/.next/static && cp -r public .next/standalone/apps/admin/public",
|
||||
"start": "PORT=9001 dotenv -e ../../.env -- node .next/standalone/apps/admin/server.js",
|
||||
"lint": "next lint",
|
||||
"lint:fix": "next lint --fix",
|
||||
"typecheck": "tsc --noEmit"
|
||||
|
||||
3
apps/student/.env.example
Normal file
3
apps/student/.env.example
Normal file
@@ -0,0 +1,3 @@
|
||||
ADMIN_DOMAIN=http://localhost:9001
|
||||
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/nextplacement
|
||||
AUTH_SECRET=change_me
|
||||
@@ -40,6 +40,9 @@ export default function JobApplicationModal({ job, studentId, resumes, isApplied
|
||||
const [isPending, startTransition] = useTransition();
|
||||
const [message, setMessage] = useState<{ type: 'success' | 'error'; text: string } | null>(null);
|
||||
|
||||
const deadline = new Date(job.applicationDeadline);
|
||||
const isDeadlinePassed = new Date() > deadline;
|
||||
|
||||
const handleApply = async () => {
|
||||
if (!selectedResume) {
|
||||
setMessage({ type: 'error', text: 'Please select a resume' });
|
||||
@@ -63,12 +66,14 @@ export default function JobApplicationModal({ job, studentId, resumes, isApplied
|
||||
setMessage({ type: 'error', text: result.error || 'Failed to submit application' });
|
||||
}
|
||||
} catch (error) {
|
||||
setMessage({ type: 'error', text: 'An error occurred while submitting your application' });
|
||||
setMessage({
|
||||
type: 'error',
|
||||
text: error instanceof Error ? error.message : 'An error occurred while submitting your application'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const isDeadlinePassed = new Date() > new Date(job.applicationDeadline as any);
|
||||
const cannotApplyReason = isApplied
|
||||
? 'You have already applied to this job'
|
||||
: resumes.length === 0
|
||||
@@ -78,21 +83,33 @@ export default function JobApplicationModal({ job, studentId, resumes, isApplied
|
||||
: null;
|
||||
|
||||
return (
|
||||
<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<Dialog open={isOpen} onOpenChange={(open) => !isPending && setIsOpen(open)}>
|
||||
{!cannotApplyReason && (
|
||||
<DialogTrigger asChild>
|
||||
<div className="flex flex-col items-start">
|
||||
<Button
|
||||
size="sm"
|
||||
className="bg-blue-600 hover:bg-blue-700"
|
||||
>
|
||||
Apply Now
|
||||
</Button>
|
||||
</div>
|
||||
</DialogTrigger>
|
||||
)}
|
||||
|
||||
{cannotApplyReason && (
|
||||
<div className="flex flex-col items-start">
|
||||
<Button
|
||||
size="sm"
|
||||
className="bg-blue-600 hover:bg-blue-700"
|
||||
disabled={Boolean(cannotApplyReason)}
|
||||
disabled
|
||||
>
|
||||
{isApplied ? 'Applied' : 'Apply Now'}
|
||||
</Button>
|
||||
{cannotApplyReason && (
|
||||
<span className="mt-1 text-xs text-red-600">{cannotApplyReason}</span>
|
||||
)}
|
||||
<span className="mt-1 text-xs text-red-600">{cannotApplyReason}</span>
|
||||
</div>
|
||||
</DialogTrigger>
|
||||
)}
|
||||
|
||||
<DialogContent className="max-w-2xl max-h-[90vh] overflow-y-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
@@ -127,7 +144,7 @@ export default function JobApplicationModal({ job, studentId, resumes, isApplied
|
||||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
<Calendar className="w-4 h-4" />
|
||||
<span>Deadline: {job.applicationDeadline.toLocaleDateString()}</span>
|
||||
<span>Deadline: {deadline.toLocaleDateString()}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
<Star className="w-4 h-4" />
|
||||
@@ -162,6 +179,18 @@ export default function JobApplicationModal({ job, studentId, resumes, isApplied
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
{selectedResume && (
|
||||
<a
|
||||
href={resumes.find(r => r.id.toString() === selectedResume)?.fileUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-sm text-blue-600 underline mt-2 inline-block"
|
||||
>
|
||||
Preview selected resume
|
||||
</a>
|
||||
)}
|
||||
|
||||
{resumes.length === 0 && (
|
||||
<p className="text-sm text-red-600 mt-1">
|
||||
No resumes found. Please upload a resume first.
|
||||
@@ -171,11 +200,10 @@ export default function JobApplicationModal({ job, studentId, resumes, isApplied
|
||||
|
||||
{/* Message Display */}
|
||||
{message && (
|
||||
<div className={`p-3 rounded-lg ${
|
||||
message.type === 'success'
|
||||
<div className={`p-3 rounded-lg ${message.type === 'success'
|
||||
? 'bg-green-100 text-green-700 border border-green-200'
|
||||
: 'bg-red-100 text-red-700 border border-red-200'
|
||||
}`}>
|
||||
}`}>
|
||||
<div className="flex items-center gap-2">
|
||||
{message.type === 'success' ? (
|
||||
<CheckCircle className="w-4 h-4" />
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "dotenv -e ../../.env -- next dev --turbopack -p 9000",
|
||||
"build": "dotenv -e ../../.env -- next build",
|
||||
"start": "dotenv -e ../../.env -- next start -p 9000",
|
||||
"build": "dotenv -e ../../.env -- next build && cp -r .next/static .next/standalone/apps/student/.next/static && cp -r public .next/standalone/apps/student/public",
|
||||
"start": "PORT=9000 dotenv -e ../../.env -- node .next/standalone/apps/student/server.js",
|
||||
"lint": "next lint",
|
||||
"lint:fix": "next lint --fix",
|
||||
"typecheck": "tsc --noEmit"
|
||||
@@ -20,7 +20,7 @@
|
||||
"framer-motion": "^12.22.0",
|
||||
"lucide-react": "^0.475.0",
|
||||
"next": "^15.3.4",
|
||||
"next-auth": "5.0.0-beta.30",
|
||||
"next-auth": "5.0.0-beta.29",
|
||||
"next-themes": "^0.4.6",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
|
||||
1
nextplacement
Submodule
1
nextplacement
Submodule
Submodule nextplacement added at 1648a56680
Reference in New Issue
Block a user