Code Monkey home page Code Monkey logo

job-finder-go's People

Contributors

aalug avatar

Watchers

 avatar

job-finder-go's Issues

Add get user API

Add get user API.
This is basic and quite uncomplicated function but its needed for example for getting profile details before updating.
Test the function.

Add employers table

Create a new table called employers with columns such as:

  • id,
  • company_id,
  • full_name,
  • email,
  • hashed_password.

The company_id column would be a foreign key referencing the id column in the companies table. This would allow to associate an employer with a company.

Then add functionality to allow these employers to create jobs and job skills. This could involve inserting rows into the jobs and job_skills tables, respectively.

Create job applications table and CRUD functions

Create job applications table and functions for handling CRUD operations.
This table should have job_id, user_id, message, and cv fields.
Every user should be allowed to create just one application for one job - create a unique constraint.
Using the sqlc generate functions to create, update, delete, get, and list jobs for employers and users (different details should be returned)
Test all functions.

Add delete employer API

Add delete employer API.
Add a function to handle DELETE requests and delete the employer's company and the employer itself.
Test the function.

Add get job application for user API

Add get job application for user API.
It should handle GET requests and return data specified for the user (already exists specific database db function) if the user is authenticated and is the applicant/ owner of the application.
For now, the cv will be in []byte format, later file server will be created and the cv hosted there.
Test the function.

Add update user password API

Add update user password API.
Create a function to handle changing passwords.
The request body should contain:

  • old password
  • new password

The function has to check if the old password from the request body is the same as user.HashedPassword,
if it is, then new password should be hashed and set as as new password.

Restructure the project

Restructure the project.
Change the structure of the project to use the standard go project structure (cmd, internal, pkg).

Move:

  • api
  • db
  • esearch
  • config (create from config.go file from utils to allow utils to go to the pkg)

packages to the internal folder.

Move:

  • utils
  • token
  • validation

packages to the pkg folder.

Move the main.go file to cmd folder.

Update all imports and fix all bugs that were caused but these changes.

Add delete user API

Add delete user API.
It should allow users to delete their accounts.
First, delete all user skills, then delete the user that has made the request.

Enhancing Job Creation Process with Elasticsearch Indexing

Enhancing Job Creation Process with Elasticsearch Indexing
Add functionality to createJob function for it to create jobs index afret new job is created.
To accomplish this, new esearch function will be required. It should create just one index for just one job.
Update function tests.

Create SQL store and add transactions to handle multiple job and user skills

Create SQL store and add transactions to handle multiple job and user skills.
These functions should accept as arguments slices of data required to create a job skill and user skill, and using existing functions to create skills, create all of them.
Using sqlc add functions to delete multiple job and user skills and to delete all skills of a specific job.

Setup elasticsearch

Setup elasticsearch, create:

  • elasticsearch docker container
  • function to load data from the database
  • function to connect to the elasticsearch server

Implement user login

Implement user login:

  • create functions to create and validate a token
  • create an API to handle POST requests to login user
    The function should validate the input data, check password correctness, and get and return user details alongside the access token.

Add auth middleware

Add auth middleware that to protect routes.
It should check if the user is authenticated and if not - restrict from calling an endpoint.

Add create user API

Add create user API.
It should handle POST requests and create users.
The function should validate data, hash the password, create a user, and create user_skills for the user.
Mock the store and test the function.

Add create job application API

Add create job application API.
It should handle receiving:

  • message (string, optional)
  • job_id (int32, required)
  • cv (multipart.File, required)

It should validate received data and if everything is valid, create db.JobApplication with default status - Applied.
Test the function.

Create function to search jobs using Elasticsearch

Create a function to search for jobs using Elasticsearch.

The function should take two parameters:

  • context
  • query string

It should perform elasticsearch search to get jobs with the same or similar:

  • title
  • description
  • requirements
  • skills
  • location

It should return a slice of jobs which later will be used to handle API requests.

Add get employer API

Add get employer API.
It should return information about the logged-in employer and it's company.
Test the function.

Add db init schema

Write an initial database schema in Postgres.
Use golang-migrate to run migrations.
This schema should contain tables such as:

  • users
  • jobs
  • companies
  • job_skills
  • user_skills

Create CRUD for user_skills table

Generate functions for CRUD operations with sqlc for the user_skills table.
Test functions.
Update the job_test file, and test ListJobsMatchingUserSkills function (it required job_skills and user_skills to test it)

Add get job application for employer API

Add get job application for employer API.
It should handle GET requests and return data specified for the employer (already exists specific database function) if the employer is authenticated and is part of the company that owns this job posting (employer.CompanyID == companyID, where companyID was got by another db function that gets companyID by JobID)
For now, the cv will be in []byte format, later file server will be created and the cv hosted there.
Test the function.

Add list jobs by matching user skills API

Add list jobs by matching user skills API.
Create a function to handle GET requests with query parameters (page number and page size) that for authenticated users will return array of jobs that match their skills.
Test the function.

Add restrictions to deleting job skills

Add restrictions to deleting job skills.
Add to functions that delete job skills a check that will allow deleting of job skills only if the employer making the request is the author of these skills.

Add get job details API

Add get job details API.
Make changes to the GetJob query (function generated by sqlc) to select not only the job but also company and employer informations. This endpoint should receive in the url an id of a job and get all needed details.
This function should not return job skills - this sould be handled by another function to allow client to get paginated job skills.

Add search jobs API

Add search jobs API.
Create a function to handle GET requests with query parameters:

  • page (page number)
  • page_size (number of jobs per page)
  • search (search query that will be passed to the esearch.SearchJobs function)

Validate the query (all 3 parameters should be required).
Call the esearch.SearchJobs function with provided data.
Return received jobs in JSON format.

Handle job application unique constraint violation (userID, jobID)

Handle job application unique constraint violation (userID, jobID).
There is a unique constraint in the database not to allow creating job applications where the job_id and user_id pair already exist.
Add a check for this case in the createJobApplication handler.
Test this new functionality.

Add update user API

Add update user API.
It should allow authenticated users to update their account details.
Users should be able to update all data except the password. It will be handled with a different endpoint.
Test the function.

Add login employer API

Add login employer API.
It will look almost like login user API - the basic principle is the same (get employer, check the password, return details)

Add update job posting API

Add update job posting API.
Create a function to handle PATCH requests that updates job and job skills.
There should be validation that will allow only job owners to make changes in a job and check the validity of the request body (similarly to the function that creates the job).

Add delete job API

Add delete job API.
Create a function to handle deleting a job posting.
The function should check if the employer making the request is the owner of the job - if not, 401 status should be returned.
Test the function.

Add create job API

The API should accept the job details and a list of required skills in the request.
Upon receiving the request, the job will be created in the database. Upon successful creation of the job, the necessary skills will be created and assigned to the newly created job.
Test the functionality of this API.

Add list jobs by company API

Add list jobs by company API.
Create a function to handle GET requests that returns a list of jobs created by a specific company.
Query params:

  • page (page number)
  • page_size (number of items per page)

and either:

  • id (company id)

or

  • name (company name)

or

  • name_contains (part of the company name)

The function should allow only one of those parameters and based on which one was provided call the appropriate database function.

Add create employer API

Add create employer API.
Create a function to handle POST requests to create an employer.
To create an employer, a company ID is required, so the request should contain information for both of those objects, and the function should create them both.

Add automatic indexing of jobs

Add automatic indexing of jobs after job is created or updated.
Right now, indexes are created by calling one function that loads all jobs from the database and creates indexes. That is not very efficient. Create a function to index jobs after creation or update of a job object.
Add it to functions that handle API calls.

Implement hashing passwords

Implement hashing passwords with bcrypt.
Create functions to:

  • hash password
  • check password (compare string passed as a password in a POST request to the hashed value in the database)

Fix email validation

Fix validation.ValidateEmail function. For some reqson it says that email without a top-level domain (e.g. .com) is valid (e.g. test@example)
Test the function.

Add filter and list jobs API

Add filter and list jobs API.
Create a new SQL function to allow users to filter jobs by location, title, industry, and salary range.
It should all be done in one go.
Create a function to handle GET requests with query parameters (filters, page number, and page size).
Test the function.

Modify CORS middleware

Modify CORS middleware to accept authorization headers.
The rest of the CORS config should remain the same.

Add update employer password API

Add update employer password API.
Create a function to handle changing employer passwords.
The request body should contain:

  • old password
  • new password

The function has to check if the old password from the request body is the same as employer.HashedPassword,
if it is, then new password should be hashed and set as as new password.

Add update employer API

Add update employer API.
It should allow authenticated employers to update their account and company details.
Employers should be able to update all data except the password. It will be handled with a different endpoint.
Test the function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.