CV Platform is a web application built with Ruby on Rails that allows users to create, manage, and share their CVs (Resumes) online.
- Custom user authentication system (without external gems like Devise)
- User profile management with avatar upload
- CV creation and management
- Dynamic CV listing and search functionality
- Responsive design with Tailwind CSS
- Rich text editing for CV descriptions
- API endpoints for CV listing and details
- School information management with nested forms
Before you begin, ensure you have the following installed:
- Ruby (version 2.7.0 or later)
- Rails (version 6.1.0 or later)
- Node.js (version 12.0.0 or later)
- Yarn (version 1.22.0 or later)
- PostgreSQL (version 12.0 or later)
-
Clone the repository:
git clone https://gitlab.com/ahmetayhan/cv_platform.git cd cv-platform
-
Install Ruby dependencies:
bundle install
-
Install JavaScript dependencies:
yarn install
-
Set up the database:
rails db:create rails db:migrate rails db:seed
-
Set up Active Storage:
rails active_storage:install rails db:migrate
-
Start the Rails server:
rails server
-
In a separate terminal, start the Webpacker dev server:
./bin/webpack-dev-server
-
Visit
http://localhost:3000
in your web browser.
- Fields: first_name, last_name, email, gsm (encrypted), country, password_digest, identity_number (encrypted)
- Custom authentication implementation
- Fields: title, description (rich text), hobbies, active
- Associated with User and School models
- Fields: name
- Many-to-many relationship with Resume
- Home page with CV listing and real-time search using Stimulus and Turbo Frames
- Profile management with avatar upload
- CV management with nested form for school information
- CV viewing page
- API endpoints for CV listing and details
-
CV List Endpoint:
- Returns id, title, and full_name in JSON format
- Supports search parameter for filtering by title
-
CV Detail Endpoint:
- Returns all information for a specific CV by id
All API requests should be made to: http://your-api-domain.com/api/v1/
- Make a POST request to
/api/v1/sign_up
- Include the user details in the request body:
{ "user": { "first_name": "John", "last_name": "Doe", "email": "[email protected]", "password": "your_password", "password_confirmation": "your_password", "country": "USA", "gsm": "+1234567890", "identity_number": "1234567890" } }
- The response will include an auth token and user data if registration is successful.
- Make a POST request to
/api/v1/authenticate
- Include your credentials in the request body:
{ "email": "[email protected]", "password": "your_password" }
- The response will include an auth token and user data if authentication is successful.
All subsequent API requests must include the auth token in the Authorization header:
Authorization: Bearer YOUR_JWT_TOKEN
- Make a DELETE request to
/api/v1/sign_out
- Include the auth token in the Authorization header
- A successful sign out will return a 204 No Content status
- Make a GET request to
/api/v1/resumes
- Optionally, include a search parameter in the query string:
/api/v1/resumes?q[title_cont]=developer
- The response will include an array of resume objects
- Make a GET request to
/api/v1/resumes/:id
, replacing:id
with the actual resume ID - The response will include detailed information about the specified resume
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"country": "USA",
"full_name": "John Doe"
}
{
"id": 1,
"title": "Software Developer",
"user": {
"id": 1,
"full_name": "John Doe"
}
}
{
"id": 1,
"title": "Software Developer",
"description": "Experienced developer...",
"hobbies": "Coding, reading",
"active": true,
"user": {
"id": 1,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"country": "USA",
"full_name": "John Doe"
},
"schools": [
{
"id": 1,
"name": "University of Technology",
"start_date": "2015-09-01",
"end_date": "2019-06-30"
}
]
}
If an error occurs, the API will return an appropriate HTTP status code and a JSON object containing an error message. For example:
{
"error": "Resume not found"
}
Common status codes:
- 200: Successful request
- 201: Successful creation
- 204: Successful request with no content to return
- 401: Unauthorized
- 404: Resource not found
- 422: Unprocessable entity (validation errors)
To run the test suite (focused on authentication and session management):
bundle exec rspec
If you encounter issues with assets (like Tailwind CSS styles not applying), try:
-
Clearing the asset pipeline cache:
rails tmp:clear
-
Recompiling assets:
rails assets:precompile
-
Restart your Rails server.
If user avatars are not showing up:
-
Ensure the
storage
directory exists in your project root:mkdir storage
-
Check that Active Storage is properly configured in
config/storage.yml
and your environment files. -
If moving from one environment to another, manually copy the contents of the
storage
directory.